const path = require('path') //引入path模块

function resolve(dir) {
	return path.join(__dirname, dir)
}

const isDev = process.env.NODE_ENV !== 'production'

module.exports = {
	productionSourceMap: false,
	css: {
		extract: false,
		loaderOptions: {
			less: {
				lessOptions: {
					modifyVars: {
						'primary-color': '#1890FF',
						'layout-color': '#9867f7'
					},
					javascriptEnabled: true
				}
			}
		}
	},
	configureWebpack: {
		resolve: {
			alias: {
				'@': resolve('./packages')
			}
		},
		devtool: isDev ? 'source-map' : false
	}
}
